<script src="<?php echo $template->url->getLink('scripts/jQuery-File-Upload');?>/js/vendor/jquery.ui.widget.js"></script>
<script src="<?php echo $template->url->getLink('scripts/jQuery-File-Upload');?>/js/jquery.iframe-transport.js"></script>
<script src="<?php echo $template->url->getLink('scripts/jQuery-File-Upload');?>/js/jquery.fileupload.js"></script>
<script type="text/javascript" src="<?php echo $template->url->getLink('scripts/tinymce/tinymce.min.js'); ?>"></script>
<script type="text/javascript">
    tinymce.init({
        selector: "textarea",
        theme: "modern",
        relative_urls : false,
        remove_script_host : false,
        convert_urls : true,
        height:500,
        plugins: [
            "advlist autolink lists link image charmap print preview hr anchor pagebreak",
            "searchreplace wordcount visualblocks visualchars code fullscreen",
            "insertdatetime media nonbreaking save table contextmenu directionality",
            "emoticons template paste textcolor colorpicker textpattern"
        ],
        toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
        toolbar2: "print preview media | forecolor backcolor emoticons",
        image_advtab: true,
        templates: [
            {title: 'Test template 1', content: 'Test 1'},
            {title: 'Test template 2', content: 'Test 2'}
        ]
    });
</script>

<div><?php echo $template->get('sMessage');?></div>
<form action="" method="POST">
    <div class="panel panel-success">
        <div class="panel-heading">Chỉnh sửa sản phẩm</div>
        <div class="panel-body">
            <div class="form-group">
                <label>Title</label>
                <input class="form-control" type="text" name="val[title]" value="<?php echo $template->get('oProduct')->title; ?>">
            </div>

            <div class="form-group">
                <label>Danh Mục: </label>
                <select name="val[category_id]" class="form-control">
                    <?php foreach($template->aParams['aCategories'] as $key => $oCategory) : ?>
                        <option value="<?php echo $oCategory->category_id;?>"><?php echo $oCategory->title;?></option>
                        <?php endforeach;?>
                </select>
            </div>

            <div class="form-group">
                <label>Mô Tả: </label>
                <textarea class="form-control" name="val[description]"><?php echo $template->get('oProduct')->description; ?></textarea>
            </div>
            <div>
                <input class="btn btn-primary" type="submit" value="Submit">
            </div>
        </div>
    </div>
</form>
